import zhaxios from "@/api/axios";
export default {
  /**
   * @description: 养殖总面积
   * @return {Object}
   */
  getTotalArea() {
    return zhaxios.post("batch/productionBatch/queryTotalArea", {
      "status": 0,
      organizationNo: sessionStorage.organizationNo
    });
  },
  /**
   * @description: 当前所有养殖批次
   * @return {Object}
   */
  getAllBatch() {
    return zhaxios.post("batch/productionBatch/queryByCondition", {
      "status": 0,
      organizationNo: sessionStorage.organizationNo
    });
  },
  /**
   * @description: 当月告警信息-饼图
   * @return {Object}
   */
  getnowmonthalarmage(params) {
    return zhaxios.get(`alarm/alarmMessage/statistic?organizationNo=${sessionStorage.organizationNo}`, {
      "endTime": params.endTime || "2021-12-01 01:01:01",
      "startTime": params.startTime || "2020-12-01 01:01:01",
      "system": "SC"
    })
  },
  /**
   * @description: 批次告警次数
   * @return {Object}
   */
  getBatchAlarmNumber(params) {
    return zhaxios.get("alarm/alarmMessage/chart/SC")
  },
  /**
   * @description: 料肥统计表格数据
   * @return {Object}
   */
  getliaofeilist(params) {
    return zhaxios.post("inputs/inputsRecord/queryPageByCondition", {
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  /**
   * @description: 农事任务信息echart
   * @return {Object}
   */
  farmtaskdataechart(params) {
    return zhaxios.get("agriculturalTask/agriculturalTask/findTask", {
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  /**
   * @description: 农事任务信息详细信息  { 'condition':'[{ 'batchNo':'1' , 'startTime':'开始时间' , 'endTime':'结束时间' ,'agriculturalWorkTypeId':'1'
   * @return {Object}
   */
  farmtaskdataemessage(params) {
    return zhaxios.post("agriculturalTask/agriculturalTask/queryByConditionAndTime", {
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  /**
   * @description: 农资投入信息echart
   * @return {Object}
   */
  farmsourceinputechart(params) {
    return zhaxios.get("inputs/inputsRecord/queryInfoByCondition", {
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  /**
   * @description: 条件查询批次详细信息
   * @return {Object}
   */
  getbycondBatch(params) {
    return zhaxios.post("batch/productionBatch/queryByCondition", {
      // "status": false,
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  /**
   * @description: 条件查询告警信息
   * @return {Object}
   */
  getalarmmessage(params) {
    return zhaxios.post("alarm/alarmMessage/queryByCondition", {
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  /**
   * @description: 条件查询告警信息分页查十条
   * @return {Object}
   */
  getalarmmessagetwo(params) {
    return zhaxios.post("alarm/alarmMessage/queryPageList", {
      page: 1,
      size: 10,
      entity: {
        ...params,
        organizationNo: sessionStorage.organizationNo
      }
    })
  },
  /**
   * @description: 查询当月农事任务占比饼图
   * @return {Object}
   */
  getnowmonthfarmtaskpie(params) {
    return zhaxios.get("agriculturalTask/agriculturalTask/findAgricultural", {
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  /**
   * @description: 查询当月处理结果数量
   * @return {Object}
   */
  getnowmonthhandingtasknum(params) {
    return zhaxios.get("agriculturalTask/agriculturalTask/findMonthResult", {
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  /**
   * @description: 查询即将逾期的任务
   * @return {Object}
   */
  getoldtasklist(params) {
    return zhaxios.get("agriculturalTask/agriculturalTask/findOverdue", {
      ...params,
      organizationNo: sessionStorage.organizationNo
    })
  },
  StagingSheepInfo(params) {
    return zhaxios.get(`sheep/sheep/queryStagingSheepInfo?organizationNo=${sessionStorage.organizationNo}&breedTypeNo=${sessionStorage.breedTypeNo}`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  },
  StagingSheepType(params) {
    return zhaxios.get(`sheep/sheep/queryStagingSheepType?organizationNo=${sessionStorage.organizationNo}&breedTypeNo=${sessionStorage.breedTypeNo}&populationType=${params.populationType}`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  },
  StagingSheepParity(params) {
    return zhaxios.get(`sheep/sheep/queryStagingSheepParity?organizationNo=${sessionStorage.organizationNo}&breedTypeNo=${sessionStorage.breedTypeNo}&populationType=${params.populationType}`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  },
  StagingSheepBreeding(params) {
    return zhaxios.get(`sheep/sheep/queryStagingSheepBreeding?organizationNo=${sessionStorage.organizationNo}&breedTypeNo=${sessionStorage.breedTypeNo}&populationType=${params.populationType}`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  },
  StagingSheepTypeInfo(params) {
    return zhaxios.get(`sheep/sheep/queryStagingSheepTypeInfo?organizationNo=${sessionStorage.organizationNo}&breedTypeNo=${sessionStorage.breedTypeNo}&populationType=${params.populationType}&type=${params.type}`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  },
  StagingSheepParityInfo(params) {
    return zhaxios.get(`sheep/sheep/queryStagingSheepParityInfo?organizationNo=${sessionStorage.organizationNo}&breedTypeNo=${sessionStorage.breedTypeNo}&populationType=${params.populationType}&type=${params.type}`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  },
  StagingSheepBreedingInfo(params) {
    return zhaxios.get(`sheep/sheep/queryStagingSheepBreedingInfo?organizationNo=${sessionStorage.organizationNo}&breedTypeNo=${sessionStorage.breedTypeNo}&populationType=${params.populationType}&type=${params.type}`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  },
  // 按批次查看活羔率
  queryLambingRateByBatch(params) {
    return zhaxios.get(`breed/lambing/queryLambingRateByBatchNo?organizationNo=${sessionStorage.organizationNo}&breedTypeNo=${sessionStorage.breedTypeNo}&batchNo=${params.batchNo}`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  },
  // 按批次查看活羔率
  queryLiveLambingRateByBatch(params) {
    return zhaxios.get(`breed/lambing/queryLiveLambingRateByBatchNo?organizationNo=${sessionStorage.organizationNo}&breedTypeNo=${sessionStorage.breedTypeNo}&batchNo=${params.batchNo}`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  },
  // 按批次查看羔皮等级
  querySkinRateByBatch(params) {
    return zhaxios.get(`breed/lambing/querySkinRateByBatchNo?organizationNo=${sessionStorage.organizationNo}&breedTypeNo=${sessionStorage.breedTypeNo}&batchNo=${params.batchNo}`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  },
  // 按批次查看羔羊信息
  queryLambByBatch(params) {
    return zhaxios.get(`breed/lambing/queryLambByBatchNo?organizationNo=${sessionStorage.organizationNo}&breedTypeNo=${sessionStorage.breedTypeNo}&batchNo=${params.batchNo}`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  },
  // 按批次查看受胎率
  queryWeaningSurvivalRateByBatch(params) {
    return zhaxios.get(`breed/lambing/queryWeaningSurvivalRateByBatchNo?organizationNo=${sessionStorage.organizationNo}&breedTypeNo=${sessionStorage.breedTypeNo}&batchNo=${params.batchNo}`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  },
  // 按批次查看断奶成活率
  queryConceptionRateByBatch(params) {
    return zhaxios.get(`breed/gestation/queryConceptionRateByBatchNo?organizationNo=${sessionStorage.organizationNo}&breedTypeNo=${sessionStorage.breedTypeNo}&batchNo=${params.batchNo}`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  },
  conditionDailyQuery(params) {
    return zhaxios.post(`breed/breedingRecord/queryDailyInfo`, {
      ...params,
      organizationNo: sessionStorage.organizationNo,
      breedTypeNo: sessionStorage.breedTypeNo
    })
  }
}
